﻿using log4net;

namespace Common.Core.Log
{
    public static class LogHelper
    {
        static LogHelper()
        {
            //程序启动时已经注册
            //log4net.Config.XmlConfigurator.Configure(new FileInfo("log4net.xml"));
        }
        
        private static readonly ILog log = LogManager.GetLogger("logerror");

        public static void Debug(string message, Exception ex = null)
        {
            log.Debug(message, ex);
        }

        public static void Info(string message, Exception ex = null)
        {
            log.Info(message, ex);
        }

        public static void Warn(string message, Exception ex = null)
        {
            log.Info(message, ex);
        }

        public static void Error(string message, Exception ex=null)
        {
            log.Error(message, ex);
        }
    }
}
